package com.ddone.ioc.demo.service;

import com.ddone.ioc.demo.bean.Address;
import com.ddone.ioc.demo.config.DemoConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import javax.annotation.Resource;

/**
 * @author ddone
 * @date 2024/3/19-16:39
 */
@RunWith(SpringJUnit4ClassRunner.class)
//指定spring测试环境工作的类 他帮助我们创建容器对象
// @ContextConfiguration(value = {"classpath:application-anno.xml"})
// //指定spring的配置文件xml
@ContextConfiguration(classes = {DemoConfig.class})
public class JunitSpringTest {
    @Resource
    private Address address;

    @Test
    public void testUser(){
        System.out.println("address = " + address);
    }
}
